<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>登录界面</title>
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
	</head>
	<body>
		<div class="container" style="width: 300px;margin-top: 100px;">
			<fieldset>
			<legend>登录</legend>
			<div class="form-group">
				<label for="username">用户名：</label>
				<input class="form-control" autocomplete="off"
				 type="text" name="username" id="username" />
			</div>
			<div class="form-group">
			<label for="password">密码：</label>
			<input class="form-control" autocomplete="off"
			type="password" name="password" id="password"  />
			</div>
			<div>
				<button class="btn btn-primary" onclick="save()">保存</button>
				<button class="btn btn-danger"onclick="clera()">取消</button>
			</div>
			</fieldset>
		</div>
	</body>
	<script>
		//点击保存的按钮 获取用户名和密码 打印到控制台
		function save(){
			var username=document.getElementById("username");
			console.log(username.value);
			
			let password = document.getElementById("password");
			console.log(password.value);
		}
		function clera(){
			//清空方法 获取这两个框，
			document.getElementById("username").value="";
			document.getElementById("password").value="";
		}
	</script>
</html>
